package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * 对象流
 * */
public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "帕瓦";
        int age = 18;
        String gender = "女";
        String[] otherInfo = {"血之恶魔","喜欢喵子","依赖电次"};

        Person p = new Person(name,gender,age,otherInfo);

        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);

        oos.writeObject(p);
        System.out.println("对象写入完毕");
        oos.close();
    }
}
